feat(miner-portfolio): add PortfolioQueueManager caps-aware batch claim (#4285) - #4493
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-09 22:10:47 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4493 +/- ##
=======================================
Coverage 94.03% 94.03%
=======================================
Files 420 420
Lines 37521 37521
Branches 13701 13701
=======================================
Hits 35282 35282
Misses 1583 1583
Partials 656 656 🚀 New features to boost your workflow:
|
Closes #4285
Summary
packages/gittensory-miner/lib/portfolio-queue-manager.js: compose the persisted SQLite store (initPortfolioQueueStore) with the engine's purenextEligibleItemsselector so batch claiming respectsglobalWipCap/perRepoWipCapand cross-repo diversification.portfolio-queue.jswith a transactionalbatchClaim(selectFn)hook (BEGIN IMMEDIATE → re-read active rows → claim still-queued targets viaUPDATE … RETURNING) so concurrent writers cannot double-claim.entriesToPortfolioQueue,selectEligibleBatch,queueItemId) for unit tests without touching the CLI.The existing
gittensory-miner queue nextsingle-row path is unchanged.Scope
claimNextBatch()on the manager (constructor/functioncapsargument only — no.gittensory-miner.ymlwiring)packages/gittensory-engine/test/portfolio-queue.test.tsscenariosTest plan
test/unit/miner-portfolio-queue-manager.test.ts— empty queue, per-repo cap saturation, multi-repo diversification, zero caps, concurrent claim safetynpm run build:minernpm run test:cigreennpm audit --audit-level=moderatecleanValidation
Changed files
packages/gittensory-miner/lib/portfolio-queue-manager.jspackages/gittensory-miner/lib/portfolio-queue-manager.d.tspackages/gittensory-miner/lib/portfolio-queue.jsbatchClaim()for race-safe multi-row claimspackages/gittensory-miner/lib/portfolio-queue.d.tsbatchClaimon store typepackages/gittensory-miner/package.jsontest/unit/miner-portfolio-queue-manager.test.ts